package com.easybuy.service.impl;

import com.easybuy.bean.EasybuyUser;
import com.easybuy.mapper.EasybuyUserMapper;
import com.easybuy.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private EasybuyUserMapper easybuyUserMapper;

    @Override
    public List<EasybuyUser> listUserByPage(int page, int pageSize){
        int from=(page-1)*pageSize;
        return easybuyUserMapper.listUserByPage(from,pageSize);
    }

    @Override
    public int save(EasybuyUser easybuyUser) {
        return easybuyUserMapper.save(easybuyUser);
    }

    @Override
    public EasybuyUser selectByPK(EasybuyUser easybuyUser) {
        return easybuyUserMapper.selectByPK(easybuyUser);
    }


    //通过主键删除
    @Override
    public Integer deleteByPK(String euUserId) {
        return easybuyUserMapper.deleteByPK(euUserId);
    }


    //通过主键修改
    @Override
    public Integer updatByPK(EasybuyUser easybuyUser) {
        return easybuyUserMapper.updateByPK(easybuyUser);
    }


    //分页号码
    @Override
    public int countAll(){
        return easybuyUserMapper.countAll();
    }

}
